package com.easygoods.shiro.token;

import com.bestvike.stone.spring.exception.AssertUtils;
import com.bestvike.stone.spring.rest.IRequest;
import com.bestvike.stone.spring.shiro.authc.AuthenticationToken;
import com.easygoods.enums.AvatarType;
import com.easygoods.enums.Channel;
import lombok.Data;

import javax.annotation.Resource;

/**
 * Created by 许崇雷 on 2019-03-12.
 */
@Data
public final class ChannelToken implements AuthenticationToken, IRequest {
    private Channel channel;
    private String openId;
    private String nickName;
    private AvatarType avatarType;

    private String avatar;

    @Override
    public void assertValid() {
        AssertUtils.notNull(this.channel, "channel");
        AssertUtils.hasText(this.openId, "openid");
    }
}
